#include<iostream>
#include<algorithm>

using namespace std;

int main()
{
	int k=0;
	int days=0;
    int month[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
    for(int i=2000;i<=2020;i++)
	{
		for(int m=1;m<=12;m++)
		{
			if(i%4==0)
			    month[2]=29;
			for(int j=1;j<=month[m];j++)
			{
				if(i==2020&&m==10&&j==2)
				    cout<<k<<endl<<days;
				days=(days+1)%7;
				k++;
				if(days==3||j==1)
				    k++;
			}
		}
	}
	return 0;
 } 
 //(2000.1.1-2019.12.31)365*20+1+1+1+1+1
 //(2020.1.1-2020.10.1)31+29+31+30+31+30+31+31+30+31+31+30
 //7671
 //mon[]  week[]
